/**
 * create by young (young2f@outlook.com) on 2020/2/26
 */
'use strict';
import request from '../utils/request';

export default class TreeNode {
  static async getTree(data) {
    return request('/api/tree/find', {
      method: 'POST',
      body: data,
    });
  }

  static async getNodes(data) {
    return request('/api/tree/nodes/find', {
      method: 'POST',
      body: data,
    });
  }
  static async findTreesWithAuth(data) {
    return request('/api/trees/find/auth', {
      method: 'POST',
      body: data,
    });
  }
  static async getData(body) {
    return request('/api/tree/data/find', {
      method: 'POST',
      body,
    });
  }
  static async updateNode(data) {
    return request('/api/tree/node/update', {
      method: 'POST',
      body: data,
    });
  }

  static async insertBatch(data) {
    return request('/api/tree/node/create/batch', {
      method: 'POST',
      body: data,
    });
  }

  static async clear(data) {
    return request('/api/tree/node/clear', {
      method: 'POST',
      body: data,
    });
  }
  static async deleteNode(data) {
    return request('/api/tree/node/delete', {
      method: 'POST',
      body: data,
    });
  }
  static async moveNode(data) {
    return request('/api/tree/node/move', {
      method: 'POST',
      body: data,
    });
  }
  static async copyNode(data) {
    return request('/api/tree/node/copy', {
      method: 'POST',
      body: data,
    });
  }
  static async moveTreeData(data) {
    return request('/api/tree/data/move', {
      method: 'POST',
      body: data,
    });
  }
  static async setConfig(data) {
    return request('/api/tree/node/config', {
      method: 'POST',
      body: data,
    });
  }




  static async getNodeById(data) {
    return request('/api/tree/node/find/byId', {
      method: 'POST',
      body: data,
    });
  }





  static async insert(data) {
    return request('/api/tree/node/create', {
      method: 'POST',
      body: data,
    });
  }



  static async getInfoById(data) {
    return request('/api/tree/info/find/byId', {
      method: 'POST',
      body: data,
    });
  }





  static async createDataId(data) {
    return request('/api/tree/data/id/create', {
      method: 'POST',
      body: data,
    });
  }

  static async getMaterialTreeData(body) {
    return request('/api/material/tree/data/find', {
      method: 'POST',
      body,
    });
  }
}
